package cn.jdbc.mysql;
//mysql build
import java.sql.*;

public class Test01 {
    public static void main(String[] args)throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/mysql?useSSL=false";
        String username="root";
        String password="root";
        Connection connection = DriverManager.getConnection(url, username,
                password);
        Statement statement = connection.createStatement();
        ResultSet resultSet = statement.executeQuery("select version()");
            resultSet.next();
        String string = resultSet.getString(1);
        System.out.println(string);
        connection.close();
    }
}
